class Background extends Spirit {
  constructor() {
    super('img/bg.jpg')
    this.speed = 1
  }

  update() {
    this.y += this.speed
    if (this.y > this.h) {
      this.y = 0
    }
  }

  draw(context) {
    let x2 = this.x
    let y2 = this.y - this.h
    if (this.loaded) {
      context.drawImage(this.img, this.x, this.y)
      context.drawImage(this.img, x2, y2)
    }
  }
}